#!coding=utf-8
from django.db import models
import settings
from enterprise_basic_information.models import *

#表七
#污染防治及特征化学污染物排放情况
class   Pollution_prevention_control(models.Model):
    #废水产生情况
    water_quantity = models.CharField(u'废水产生量(吨/年)',max_length = 30)
    #废水处理情况
    water_processing_entrust = models.CharField(u'委托处理',max_length = 30)
    water_entrust = models.CharField(u'接受委托单位名称',max_length = 30)
    #自处理设施
    water_processing_self = models.CharField(u'自处理',max_length = 30)
    water_other_No = models.CharField(u'其他编号',max_length = 30)
    water_process_facility = models.CharField(u'废水处理设施名称',max_length = 30)
    water_pollutant_name = models.CharField(u'处理的主要污染物名称',max_length = 30)
    water_process_method = models.CharField(u'处理方法代码',max_length = 30)
    water_ability = models.CharField(u'设计处理能力(吨/日)',max_length = 30)
    water_last_year = models.CharField(u'上年实际处理量(吨/年)',max_length = 30)
    water_whereabouts = models.CharField(u'处理后废水去向',max_length = 30)
    #预处理设施
    water_processing_pre = models.CharField(u'预处理',max_length = 30)
    water_pre_other_No = models.CharField(u'其他编号',max_length = 30)
    water_pre_process_facility = models.CharField(u'废水处理设施名称',max_length = 30)
    water_pre_pollutant_name = models.CharField(u'处理的主要污染物名称',max_length = 30)
    water_pre_process_method = models.CharField(u'处理方法代码',max_length = 30)
    water_pre_ability = models.CharField(u'设计处理能力(吨/日)',max_length = 30)
    water_pre_last_year = models.CharField(u'上年实际处理量(吨/年)',max_length = 30)
    water_pre_whereabouts = models.CharField(u'处理后废水去向',max_length = 30)
    #废水排放口情况
    water_discharge_port_No = models.CharField(u'其他编号',max_length = 30)
    water_whereabouts_code = models.CharField(u'废水排放去向类型代码',max_length = 30)
    water_emission = models.CharField(u'废水排放量(吨/年)',max_length = 30)
    water_receive = models.CharField(u'受纳水体名称',max_length = 30)
    water_receive_code = models.CharField(u'受纳水体代码',max_length = 30)
    water_total = models.CharField(u'总计',max_length = 30)


    #工艺废气处理与排放情况
    #工艺废气处理设施
    gas_other_No = models.CharField(u'其他编号',max_length = 30)
    gas_process_facility = models.CharField(u'废气处理设施名称',max_length = 30)
    gas_pollutant_name = models.CharField(u'处理的主要污染物名称',max_length = 30)
    gas_process_method = models.CharField(u'处理方法代码',max_length = 30)
    gas_ability = models.CharField(u'设计处理能力(立方米/时)',max_length = 30)
    gas_last_year = models.CharField(u'上年实际处理量(万立方米/年)',max_length = 30)
    gas_whereabouts = models.CharField(u'处理后废气去向',max_length = 30)

    #工艺废气排放口情况
    gas_discharge_port_No = models.CharField(u'其他编号',max_length = 30)
    gas_emission = models.CharField(u'废气排放量(万立方米/年)',max_length = 30)
    gas_total = models.CharField(u'总计',max_length = 30)

    #危险废物处理处置
    contract = models.FileField(u'处置合同',upload_to= 'static\\upload\\%Y\\%m-%d',null=True,blank=True)
    qualification =models.FileField(u'接受单位资质证明',upload_to= 'static\\upload\\%Y\\%m-%d',null=True,blank=True)
    transfer = models.FileField(u'上一年度危险废物转移联单',upload_to= 'static\\upload\\%Y\\%m-%d',null=True,blank=True)

    waste_material = models.CharField(u'危险废物名称',max_length = 30)
    waste_material_code = models.CharField(u'废物代码',max_length = 30)
    waste_material_generation = models.CharField(u'产生量(吨/年)',max_length = 30)
    waste_material_use = models.CharField(u'利用量(吨/年)',max_length = 30)
    waste_material_use_method = models.CharField(u'利用方式代码',max_length = 30)
    waste_material_disposal = models.CharField(u'处置量(吨/年)',max_length = 30)
    waste_material_disposal_method = models.CharField(u'处理方式代码',max_length = 30)
    waste_material_storage = models.CharField(u'贮存量(吨)',max_length = 30)
    waste_material_transfer = models.CharField(u'转移量(吨/年)',max_length = 30)
    waste_material_receive = models.CharField(u'接收单位名称',max_length = 30)
    waste_material_business_license_number = models.CharField(u'接收单位危险废物经营许可证编号',max_length = 30)
    #自建危险贮存，处置设施情况
    waste_material_storage_capacity = models.CharField(u'贮存场容量(立方米)',max_length = 30)
    waste_material_landfill_capacity = models.CharField(u'填埋场容量(立方米)',max_length = 30)
    waste_material_disposal_facility= models.CharField(u'处置设施数量(台)',max_length = 30)
    waste_material_design_capacity = models.CharField(u'处置设施设计处理能力(吨/天)',max_length = 30)
    #特征化学污染物排放情况
    chemical_pollutant_name = models.CharField(u'特征化学污染物名称',max_length = 30)
    discharge_medium = models.CharField(u'排放介质',max_length = 30)
    discharge_amount = models.CharField(u'排放量(千克/年)',max_length = 30)
    discharge_No = models.CharField(u'排放口编号',max_length = 30)

    enterprise = models.ForeignKey(Enterprise)

    def getObj(self):
        _dict ={}

        return _dict
    
class Pollution_control_information(models.Model):
    exhaust_emissions = models.IntegerField(u'废气排放量(万立方米/年)')
    amount_waste_produced = models.IntegerField(u'废水产生量(吨/年)')
    wastewater_emissions = models.IntegerField(u'废水排放量(吨/年)')
    wastewater_discharge_code = models.CharField(u'废水排放去向代码',max_length = 30)
    
    receiving_water_name = models.CharField(u'废水受纳水体名称',max_length = 30)
    receiving_water_code = models.CharField(u'废水受纳水体代码',max_length = 30)
    
    amount_solid_waste = models.IntegerField(u'一般固体废物产生量(吨/年)')
    amount_hazardous_waste = models.IntegerField(u'危险废物产生量(吨/年)')
    to_deal_with = models.IntegerField(u'自行处理')
    commissioned_by_processing = models.IntegerField(u'委托处理 ')
    hazardous_waste_name = models.CharField(u'危险废物处置机构名称',max_length = 30)
    
    wastewater_pollutants_approved = models.IntegerField(u'批复的废水污染物排放总量（吨/年） ')
    wastegas_pollutants_approved = models.IntegerField(u'批复的废气污染物排放总量（吨/年）')
    
    enterprise = models.ForeignKey(Enterprise)

#重点环境管理危险化学品及其特征化学污染物释放与转移情况
class pollutant_transfer_situation(models.Model):
    key_environmental_name = models.CharField(u'重点环境管理危险化学品品名或其特征化学污染物名称',max_length = 100)
    key_environmental_kind = models.IntegerField(u'重点环境管理危险化学品品名或其特征化学污染物分类')

    organized_discharge = models.IntegerField(u'有组织排放 ')
    organized_discharge_release_quantity = models.IntegerField(u'释放量（千克/年)')
    organized_discharge_concentration_release = models.IntegerField(u'释放浓度（毫克/升）')
    organized_discharge_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    organized_discharge_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    organized_discharge_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    organized_discharge_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    fugitive_emissions = models.IntegerField(u'无组织排放 ')
    fugitive_emissions_release_quantity = models.IntegerField(u'释放量（千克/年)')
    fugitive_emissions_concentration_release = models.IntegerField(u'释放浓度（毫克/升）')
    fugitive_emissions_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    fugitive_emissions_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    fugitive_emissions_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    fugitive_emissions_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    subtotal_release_atmosphere = models.CharField(u'释放至大气小计',max_length = 30)
    
    
    
    
    receiving_water_name = models.CharField(u'受纳水体名称',max_length = 100) 
    receiving_water_code = models.CharField(u'受纳水体代码',max_length = 100)
    receiving_water_release_quantity = models.IntegerField(u'释放量（千克/年)')
    receiving_water_concentration_release = models.IntegerField(u'释放浓度（毫克/升）')
    receiving_water_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    receiving_water_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    receiving_water_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    receiving_water_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    #subtotal_release_water = models.CharField(u'释放至水小计',max_length = 30)
    
    release_soil_to_landfill  = models.IntegerField(u'自行填埋 ')
    release_soil_to_landfill_release_quantity = models.IntegerField(u'释放量（千克/年)')
    release_soil_to_landfill_concentration_release = models.IntegerField(u'释放浓度（毫克/升）')
    release_soil_to_landfill_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_landfill_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_landfill_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_landfill_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    release_soil_to_other  = models.IntegerField(u'其它 ')
    release_soil_to_other_release_quantity = models.IntegerField(u'释放量（千克/年)')
    release_soil_to_other_concentration_release = models.IntegerField(u'释放浓度（毫克/升）')
    release_soil_to_other_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_other_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_other_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    release_soil_to_other_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    subtotal_release_soil = models.CharField(u'释放至土壤小计',max_length = 30)
    
    subtotal_release = models.CharField(u'合计',max_length = 30)
    
    #sewage_treatment_plant = models.CharField(u'转移至污水处理厂',max_length = 100)
    sewage_treatment_plant_quantity = models.IntegerField(u'转移量（千克/年)')
    sewage_treatment_plant_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    sewage_treatment_plant_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    sewage_treatment_plant_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    sewage_treatment_plant_method_code3 = models.CharField(u'核算方法代码',max_length = 30)
    
    sewage_treatment_plant_name = models.CharField(u'污水处理厂名称',max_length = 100)
    sewage_treatment_plant_address = models.CharField(u'污水处理厂地址',max_length = 100)
    
    metastasis_subtotal_release = models.CharField(u'小计',max_length = 30)
    metastasis_release_soil = models.CharField(u'转移情况小计',max_length = 30)
    
    create_time = models.DateTimeField("创建时间",auto_now_add=True)
    
    enterprise = models.ForeignKey(Enterprise)
    
    
class Transfer_solid_waste_unit(models.Model):
    
    disposal_unit_name1 = models.CharField(u'处置单位名称1',max_length = 100)
    waste_operation_number = models.CharField(u'危险废物经营许可证编号',max_length = 100)
    
    name_solid_waste = models.CharField(u'固体废物名称',max_length = 100)
    solid_waste_form = models.IntegerField(u'固体废物形态')
    name_solid_waste_quantity = models.IntegerField(u'转移量（千克/年)')
    name_solid_waste_method_code0 = models.CharField(u'核算方法代码',max_length = 30)
    name_solid_waste_method_code1 = models.CharField(u'核算方法代码',max_length = 30)
    name_solid_waste_method_code2 = models.CharField(u'核算方法代码',max_length = 30)
    name_solid_waste_method_code3 = models.CharField(u'核算方法代码',max_length = 30)   
    situation = models.ForeignKey(pollutant_transfer_situation)   
 #其它特征化学污染物信息
class other_specific_information(models.Model):
    serial_number = models.CharField(u'序号',max_length = 100)  
    chemical_pollutants_name  = models.CharField(u'特征化学污染物名称',max_length = 100)
    corresponding_product_number  = models.CharField(u'对应产品编号',max_length = 100)  
    produce_process_node  = models.CharField(u'产生工艺节点',max_length = 100)
    medium_water = models.IntegerField("排放介质 水 ");
    medium_gas = models.IntegerField("排放介质 空气 ");
    medium_solid = models.IntegerField("排放介质 固体 ");
    emissions = models.IntegerField(u'排放量')
    discharge_port_number =  models.CharField(u'排放口编号',max_length = 100)
    
    create_time = models.DateTimeField("创建时间",auto_now_add=True)
    enterprise = models.ForeignKey(Enterprise)
    
        




